import request from "./request";

//获取用户信息的接口(用户登录)
export const userLogin = (username, password) => {
  return request({
    method: "GET",
    url: `/login?username=${username}&password=${password}`,
  });
};
//用户注册
export const userRegister = (data) => {
  return request({
    method: "POST",
    url: 'register',
    data:data
  });
};
//用户注销
export const userDelete = (id) => {
  return request({
    method: "DELETE",
    url: `cancle/${id}`,
  });
};
//用户个人信息查询(通过username)
export const reqGetUserInfo = (username) => {
  return request({
    method: "GET",
    url: `userinfo/${username}`,
  });
};
//用户个人信息查询(通过id)
export const reqGetUserInfoById = (id) => {
  return request({
    method: "GET",
    url: `login/${id}`,
  });
};
/**
* 修改用户信息
*/
export const currUserInfo = (id) => {
  return request({
    method: "PUT",
    url: `/auothers/${id}`,
  });
};